package cn.swu.Waimai.logic.dao

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper

class AddressHelper(val context: Context, name: String, version: Int): SQLiteOpenHelper(context, name, null, version) {
    private val createAddress = "create table Address ( "+
        "id integer primary key autoincrement, " +
            "place text, " + "name text," +
            "phone text)"
    override fun onCreate(db: SQLiteDatabase?) {
        db?.execSQL(createAddress)
    }

    override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
        db?.execSQL("drop table if exists Address")
        onCreate(db)
    }


}